ActiveReports Developer 7
Using the WPF Viewer
Show AllShow All
Hide AllHide All

ActiveReports provides the WPF Viewer that you can use to load and view your reports. This viewer contains a toolbar and a sidebar with Thumbnails, Search results, Document map and Parameters panes.

WPF Viewer Toolbar

WPF Viewer Sidebar

Display the report in the WPF Viewer

Set up your WPF Application project by using the following steps.

  1. Create a new WPF Application project or open an existing one. 
  2. For a new project, in the Visual Studio Solution Explorer, right-click YourProject and select Add, then New Item.
  3. In the Add New Item dialog that appears, select the ActiveReports 7 Page Report, ActiveReports 7 Section Report (code-based) or ActiveReports 7 Section Report (xml-based). This adds the necessary references to your project.
  4. From the Toolbox ActiveReports 7 tab, drag the Viewer control and drop it on the design view of MainWindow.xaml.
  5. In the Solution Explorer, right-click YourProject and select Add, then Existing Item and select an existing report to load in the viewer.
  6. In the Properties window, with the report selected, set Copy to Output Directory to Copy Always.
  7. On MainWindow.xaml, with the viewer selected, go to the Properties window and double click the Loaded event.
  8. In the MainWindow code view that appears, add code like the following to the viewer1_loaded event to bind the report to the viewer.  Each of these code snippets presumes a report in the project of the type indicated with the default name. (If you have renamed your report, you need to rename it in the code as well). 
    Note: Refer to LoadDocument method to see other ways to load a report in WPF Viewer.

    To write the code in Visual Basic.NET

    To write the code in C#

Additional Features

Following is an introduction to the additional capabilities of the Viewer to guide you on using it effectively.

Annotations Toolbar

Keyboard Shortcuts

See Also

Walkthroughs

 

 


Copyright © 2015 GrapeCity, inc. All rights reserved

Support Forum